$( document ).on( "pagecreate", "#myFlowerInfo", function( event ) {
	loadMyFlowInfo();
	//总数红花
	//$( document ).on( "click", "#flowerSumDiv", function( event ) {
	//	goTo(rootPath+"/jsp/weixin/myFlowerDetail.jsp?access_token="+access_token,true);
	//});
	//今日
	$( "#todayStatNumLi" ).on( "click", function( event ) {
		goTo(rootPath+"/jsp/weixin/myFlowerDetail.jsp?access_token="+access_token+"&type=TODAY",true);
	});
	//本周
	$(  "#weekStatNumLi" ).on( "click", function( event ) {
		goTo(rootPath+"/jsp/weixin/myFlowerDetail.jsp?access_token="+access_token+"&type=WEEK",true);
	});
	//本月
	$( "#monthStatNumLi" ).on( "click", function( event ) {
		goTo(rootPath+"/jsp/weixin/myFlowerDetail.jsp?access_token="+access_token+"&type=MONTH",true);
	});
	//本年
	$( "#yearStateNumLi" ).on( "click", function( event ) {
		goTo(rootPath+"/jsp/weixin/myFlowerDetail.jsp?access_token="+access_token+"&type=YEAR",true);
	});
});
//红花详情
function loadMyFlowInfo(){
	$.ajax({
	  	url: rootPath+"/redFlower/getAddRedFlowerNumCount.do",
	  	type: "POST",
	  	dataType: "text",
		data: "access_token="+access_token,
	  	success: function( re ) {
	  		var data=$.parseJSON(re);
			if(data.state=="200"){
		  		var flower=data.data;
		  		$("#flowerSum").text(flower.totalNum==null? 0 :flower.totalNum);
		  		$("#todayStatNum").text(flower.todayStatNum==null? 0 :flower.todayStatNum);
		  		$("#weekStatNum").text(flower.weekStatNum==null? 0 :flower.weekStatNum);
		  		$("#monthStatNum").text(flower.monthStatNum==null? 0 :flower.monthStatNum);
		  		$("#yearStateNum").text(flower.yearStateNum==null? 0 :flower.yearStateNum);
			}else{
				alert_wx('fail',data.msg);
			}
	  	}
	});
}